import coin.exchange.base.kr_rest.native_public_client_base as npubcb
import coin.exchange.coinone_v2.kr_rest.constants as exchange_constants


class CoinoneNativePublicClient(npubcb.NativePublicClientBase):
  def __init__(self):
    npubcb.NativePublicClientBase.__init__(self, url="https://api.coinone.co.kr")

  def get_ticker(self, currency):
    return self._get_as_json("ticker", params=dict(currency=currency))

  def get_orderbook(self, currency):
    return self._get_as_json("orderbook", params=dict(currency=currency))

  def queryAll(self):
    for symbol in exchange_constants.native_coin_list:
      print(self.get_orderbook(symbol))


if __name__ == "__main__":
  client = CoinoneNativePublicClient()
  client.queryAll()
